import os
import pandas as pd

# Path to your image
image_path = "3.jpg"  # Replace with the path to your image file

# Read the image file as binary
with open(image_path, "rb") as f:
    image_binary = f.read()

# Convert binary data to a list of byte values
image_bytes = list(image_binary)

# Save the binary data into a CSV file
csv_file_path = "image_binary.csv"  # You can change the name or path as needed
df = pd.DataFrame(image_bytes, columns=["Byte Value"])
df.to_csv(csv_file_path, index=False)

print(f"Binary data saved as {csv_file_path}")